<template>
	<view class="badge-search-item" :class="{ 'active': props.active }">
		<view class="iconfont">{{ props.icon }}</view>
		<view>{{ props.title }}</view>
		<view class="category-count active">{{ num }}</view>
	</view>
</template>

<script setup>
	const props = defineProps({
		icon: {
			type: String,
			default: ''
		},
		title: {
			type: String,
			default: ''
		},
		num: {
			type: Number,
			default: 0
		},
		active: {
			type: Boolean,
			default: false
		}
	});
</script>

<style scoped lang="scss">
	.badge-search-item {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 10px 16px;
		background: white;
		border: 1px solid rgba(148, 163, 184, 0.2);
		border-radius: 12px;
		font-size: 12px;
		font-weight: 600;
		color: #64748b;
		cursor: pointer;
		transition: all 0.3s ease;
		white-space: nowrap;
		position: relative;

		&.active {
			background: linear-gradient(135deg, #3b82f6, #2563eb);
			border-color: #3b82f6;
			color: white;
			box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
			
			.category-count{
				background: rgba(255, 255, 255, 0.3);
			}
		}

		.iconfont {
			font-size: 26rpx;
			font-weight: bold;
		}

		.category-count {
			color: inherit;
			padding: 2px 6px;
			border-radius: 6px;
			font-size: 12px;
			font-weight: 600;
		}

	}
</style>